<template>
  <div class="recipe-cx">
    <div class="rexipelb_box">
      <div class="rexipelb_one">
        <span class="el-icon-tableware"></span>
      </div>
      <h1>心食谱 新味道 心动不已</h1>
    </div>
    <div class="lb">
      <div class="lb_xq" >
        <h3>食谱大全</h3>
        <!-- <a>更多></a> -->
      </div>
      <div class="lb_main" v-for="i in datalist" :key="i.rid">
        <div>
          <router-link :to="`/recipexq/${i.rid}`">
            <img :src="i.r_pic" alt="" class="tptp">
          </router-link>
        </div>
        <div>
          <div>
            <router-link :to="`/recipexq/${i.rid}`">{{i.rname}}</router-link>
            <span>评分：{{i.score}}</span>
          </div>
          <div>
            <img src="/img/1.jpg" alt="">
            <router-link :to="`/userkj/${i.r_uname}`">{{i.r_uname}}</router-link>
          </div>
        </div>
      </div>
      
    </div>
  </div>
</template>

<script>
  export default {
    props:["mh"],
    data() {
      return {
        datalist: []
      }
    },
    methods: {
      getfllist() {
        console.log(this.mh)
        const url="/mhlist"
        const params=`rname=${this.mh}`
        this.axios.post(url,params).then((res)=>{
          this.datalist=res.data.data
          console.log(this.datalist)
        })
      }
    },
    mounted(){
      this.getfllist()
    },
    watch: {
      mh(newValue, oldValue) {
        this.getfllist()
      }
    },
  }
</script>

<style lang="scss" scoped>
*{
  margin: 0;
  padding: 0;
}
  .rexipe_cx{
    width: 1200px;
    margin: 0 auto;
    min-height: 10000px;
  }
  
  .lb{
    width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    border: 1px solid 	#D26900;
    margin-bottom: 25px;
    border-radius: 15px;
    background-color: rgb(228, 226, 226);
  }
  .lb_xq{
    width:1200px;
    // margin:10px;
    display:flex;
    justify-content: space-between;
    // background-color: 	#D26900;
    border-top-left-radius: 15px;
    border-top-right-radius: 15px;

    h3{
      line-height: 50px;
      font-size: 20px;
      margin-left: 10px;
    }
  }
  .lb_main{
    width: 371px;
    background-color: #ffffff;
    display: flex;
    margin: 13px 14px;
    box-sizing: border-box;
    border: 1px solid transparent;
    border-radius: 15px;
  }
  .lb_main>div{
    width: 50%;
  }
  .lb_main>div:first-child img{
    display:block;
    width: 100%;
    height: 150px;
    border-top-left-radius: 15px;
    border-bottom-left-radius: 15px;
  }
  .lb_main>div:last-child{
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    font-size: 18px;
    box-sizing: border-box;
    padding: 5px;
    padding-left: 10px;
    a{
      color: #000;
    }
    span{
      display: block;
      font-size: 14px;
      // margin-left: 5px;
      margin-top: 10px;
      padding: 5px;
      background-color: rgb(212, 209, 209);
      width: 60px;
      text-align: center;
      border-radius: 5px;}
    // span{
    //   display: block;
    //   font-size: 14px;
    //   // margin-left: 5px;
    //   margin-top: 5px;
    //   background-color: rgb(192, 191, 191);
    //   width: 60px;
    //   text-align: center;
    //   border-radius: 5px;
    // }
    div:last-child{
      display: flex;
      align-items: center;
      font-size: 16px;
      img{
        margin-right: 5px;
        width: 25px;
        border-radius: 50%;
      }
    }
  }

.rexipelb_box {
  width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  background-color: #f1f1f1;
  margin-bottom: 20px;
  border-bottom-left-radius: 10px;
  border-bottom-right-radius: 10px;
  h1 {
    width: 330px;
    height: 50px;
    font-size: 30px;
    margin: 20px 0;
    background-color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    border-top-right-radius: 10px;
    border-bottom-right-radius: 10px;
  }
}
.rexipelb_one {
  width: 50px;
  height: 50px;
  background-color: #ffe851;
  border-top-left-radius: 10px;
  border-bottom-left-radius: 10px;
  margin-left: 10px;
  display: flex;
  justify-content: center;
  align-items: center;
}
</style>